import os,sys,yaml
pro=os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))))
sys.path.append(os.path.join(pro,'easy_edit','_base_tool',"python"))
from tool_sqlite3 import base_db

print(pro)
class main:
    def __init__(self,dir_path=None,db_name='前端组件数据库'):
        if dir_path is None:
            self.组件存放文件夹=os.path.join(pro,'easy_edit','_web','vue_template_store')
        else:
            self.组件存放文件夹=dir_path
            
    def run(self,user_id,dir1_id,dir2_id,temp_id,version_id):
        #-1获取组件目录 路径
        temp_path=os.path.join(self.组件存放文件夹,'a'+str(user_id),"a"+str(dir1_id),"a"+str(dir2_id),"a"+str(temp_id),'history','a'+str(version_id))
        return {"type":"success","path":temp_path}
if __name__=="__main__":    
    obj=main()
    new_dir_path=obj.run(user_id='2',dir1_id='1',dir2_id='1',temp_id='2',version_id='8')
    print(new_dir_path)